package cn.edu.huanu.servletlearn;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * @author hb
 * @date 2025-09-28 15:47:48
 */
@WebServlet("/sb")
public class ServletB extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("\t ServletB 执行 1。。。。");
        //根据key获得请求数据包中的参数
        String key = (String)req.getAttribute("key");
        System.out.println("\t ServletB 获得参数："+key);

        System.out.println("\t ServletB 执行 2。。。。");

    }
}
